!/bin/sh

/home/liufeng/tools/bin/qemu-system-x86_64 -machine accel=kvm -hda ./test.img -m 2048 -cdrom ./RHEL6.3-20120613.2-Server-x86_64-DVD1.iso -boot d -vnc 10.238.153.194:0 -monitor telnet:10.238.153.194:6666,server,nowait


modprobe tun
tunctl -t tap100
ifconfig tap100 0 promisc up
brctl addif br0 tap100

#删除tap0
tunctl -d tap0

#光盘无网络安装
/home/kvm/tools/qemu/bin/qemu-system-x86_64 -machine accel=kvm -hda /home/kvm/disk/ubuntu.img -m 2048 -cdrom /home/kvm/iso/ubuntu-18.04.4-desktop-amd64.iso -boot d -vnc 10.111.95.32:0 -monitor telnet:10.111.95.32:6666,server,nowait

# 带网络的安装
/home/kvm/tools/qemu/bin/qemu-system-x86_64 -machine accel=kvm -hda /home/kvm/disk/ubuntu.img -m 2048 -cdrom /home/kvm/iso/ubuntu-18.04.4-desktop-amd64.iso -boot d -vnc 10.111.95.32:0 -monitor telnet:10.111.95.32:6666,server,nowait -netdev type=tap,id=eth0,ifname=tap100,script=no,downscript=no -device e1000,netdev=eth0,mac=12:03:04:05:06:08

#安装成功后
/home/kvm/tools/qemu/bin/qemu-system-x86_64 -machine accel=kvm -hda /home/kvm/disk/ubuntu.img -m 2048 -cdrom /home/kvm/iso/ubuntu-18.04.4-desktop-amd64.iso -vnc 10.111.95.32:0 -monitor telnet:10.111.95.32:6666,server,nowait -netdev type=tap,id=eth0,ifname=tap100,script=no,downscript=no -device e1000,netdev=eth0,mac=12:03:04:05:06:08




[root@my-host ~]# qemu-system-x86_64 --enable-kvm -m 1024 -smp 2 vm2.img -cdrom /data/nfs/images/CentOS-6.4-x86_64-minimal.iso --nographic -bios /usr/local/share/qemu/bios.bin -append console=ttyS0 -kernel /mnt/isolinux/vmlinuz -initrd /mnt/isolinux/initrd.img